﻿@using Whoever.Patterns.MVC.Models

@model Whoever.Health.Website.Models.ContactViewModel

@{
    ViewBag.Title = "Health!";
}
@section Scripts{
    @Content.ViewModel("ContactViewModel.js", Url)
    @Html.KOGridTemplate(model => model.List)

    <script>
        var modelData = '@Html.Raw(Model.ToJson())';
        var modelJSON = JSON.parse(modelData);

        var viewModel = new ContactViewModel(modelJSON);
        ko.applyBindings(viewModel);
    </script>
}

<div class="jumbotron color-white">
    <div class="row" data-bind="visible: Main.CurrentPage() == 'Info'">
        <div class="col-md-12">
            @Html.Partial("InfoPartial", Model)
        </div>
    </div>

    <div class="row" data-bind="visible: Main.CurrentPage() == 'Read'">
        <div class="col-md-6">
            @Html.Partial("ReadPartial", Model)
        </div>
    </div>

    <div class="row" data-bind="visible: Main.CurrentPage() == 'Create'">
        <div class="col-md-6">
            @Html.Partial("CreatePartial", Model)
        </div>
    </div>

    <div class="row" data-bind="visible: Main.CurrentPage() == 'Update'">
        <div class="col-md-6">
            @Html.Partial("UpdatePartial", Model)
        </div>
    </div>

    <div class="row" data-bind="visible: Main.CurrentPage() == 'Delete'">
        <div class="col-md-6">
            @Html.Partial("DeletePartial", Model)
        </div>
    </div>
</div>
